package com.weipai.demo.util;

import com.github.pagehelper.PageInfo;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>PageInfoUtil class.</p>
 *
 * @author M6800
 * @version $Id: $Id
 */
public class PageInfoUtil {
    /**
     * <p>pageInfoUtil.</p>
     *
     * @param pageInfo a {@link com.github.pagehelper.PageInfo} object.
     * @return a {@link Map} object.
     */
    public static Map<String, Object> pageInfoUtil(PageInfo pageInfo){
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("currentPage", pageInfo.getPageNum());
        map.put("pagesize", pageInfo.getPageSize());
        map.put("pageCount", pageInfo.getPages());
        map.put("totalRows",pageInfo.getTotal());
        return map;
    }

}
